Optimal. Leaf size=116 \[ \frac {1}{16} \left (6 a^2+b^2\right ) x-\frac {7 a b \cos ^5(c+d x)}{30 d}+\frac {\left (6 a^2+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {\left (6 a^2+b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2771, 2748,
2715, 8} \begin {gather*} \frac {\left (6 a^2+b^2\right ) \sin (c+d x) \cos ^3(c+d x)}{24 d}+\frac {\left (6 a^2+b^2\right ) \sin (c+d x) \cos (c+d x)}{16 d}+\frac {1}{16} x \left (6 a^2+b^2\right )-\frac {7 a b \cos ^5(c+d x)}{30 d}-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2748
Rule 2771
Rubi steps
\begin {align*} \int \cos ^4(c+d x) (a+b \sin (c+d x))^2 \, dx &=-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d}+\frac {1}{6} \int \cos ^4(c+d x) \left (6 a^2+b^2+7 a b \sin (c+d x)\right ) \, dx\\ &=-\frac {7 a b \cos ^5(c+d x)}{30 d}-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d}+\frac {1}{6} \left (6 a^2+b^2\right ) \int \cos ^4(c+d x) \, dx\\ &=-\frac {7 a b \cos ^5(c+d x)}{30 d}+\frac {\left (6 a^2+b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d}+\frac {1}{8} \left (6 a^2+b^2\right ) \int \cos ^2(c+d x) \, dx\\ &=-\frac {7 a b \cos ^5(c+d x)}{30 d}+\frac {\left (6 a^2+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {\left (6 a^2+b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d}+\frac {1}{16} \left (6 a^2+b^2\right ) \int 1 \, dx\\ &=\frac {1}{16} \left (6 a^2+b^2\right ) x-\frac {7 a b \cos ^5(c+d x)}{30 d}+\frac {\left (6 a^2+b^2\right ) \cos (c+d x) \sin (c+d x)}{16 d}+\frac {\left (6 a^2+b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{24 d}-\frac {b \cos ^5(c+d x) (a+b \sin (c+d x))}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 133, normalized size = 1.15 \begin {gather*} \frac {360 a^2 c+60 b^2 c+360 a^2 d x+60 b^2 d x-240 a b \cos (c+d x)-120 a b \cos (3 (c+d x))-24 a b \cos (5 (c+d x))+240 a^2 \sin (2 (c+d x))+15 b^2 \sin (2 (c+d x))+30 a^2 \sin (4 (c+d x))-15 b^2 \sin (4 (c+d x))-5 b^2 \sin (6 (c+d x))}{960 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.42, size = 108, normalized size = 0.93
method | result | size |
derivativedivides | \(\frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )-\frac {2 a b \left (\cos ^{5}\left (d x +c \right )\right )}{5}+a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(108\) |
default | \(\frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )-\frac {2 a b \left (\cos ^{5}\left (d x +c \right )\right )}{5}+a^{2} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(108\) |
risch | \(\frac {3 a^{2} x}{8}+\frac {b^{2} x}{16}-\frac {a b \cos \left (d x +c \right )}{4 d}-\frac {\sin \left (6 d x +6 c \right ) b^{2}}{192 d}-\frac {a b \cos \left (5 d x +5 c \right )}{40 d}+\frac {a^{2} \sin \left (4 d x +4 c \right )}{32 d}-\frac {\sin \left (4 d x +4 c \right ) b^{2}}{64 d}-\frac {a b \cos \left (3 d x +3 c \right )}{8 d}+\frac {a^{2} \sin \left (2 d x +2 c \right )}{4 d}+\frac {\sin \left (2 d x +2 c \right ) b^{2}}{64 d}\) | \(144\) |
norman | \(\frac {\left (\frac {3 a^{2}}{8}+\frac {b^{2}}{16}\right ) x +\left (\frac {3 a^{2}}{8}+\frac {b^{2}}{16}\right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {9 a^{2}}{4}+\frac {3 b^{2}}{8}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {9 a^{2}}{4}+\frac {3 b^{2}}{8}\right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {15 a^{2}}{2}+\frac {5 b^{2}}{4}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {45 a^{2}}{8}+\frac {15 b^{2}}{16}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {45 a^{2}}{8}+\frac {15 b^{2}}{16}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4 a b}{5 d}+\frac {\left (2 a^{2}-13 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {\left (2 a^{2}-13 b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (10 a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}-\frac {\left (10 a^{2}-b^{2}\right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {\left (42 a^{2}+47 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}-\frac {\left (42 a^{2}+47 b^{2}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}-\frac {4 a b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {8 a b \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a b \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a b \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {8 a b \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}\) | \(432\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 88, normalized size = 0.76 \begin {gather*} -\frac {384 \, a b \cos \left (d x + c\right )^{5} - 30 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} - 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} + 12 \, d x + 12 \, c - 3 \, \sin \left (4 \, d x + 4 \, c\right )\right )} b^{2}}{960 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 89, normalized size = 0.77 \begin {gather*} -\frac {96 \, a b \cos \left (d x + c\right )^{5} - 15 \, {\left (6 \, a^{2} + b^{2}\right )} d x + 5 \, {\left (8 \, b^{2} \cos \left (d x + c\right )^{5} - 2 \, {\left (6 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (6 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 287 vs.
\(2 (107) = 214\).
time = 0.44, size = 287, normalized size = 2.47 \begin {gather*} \begin {cases} \frac {3 a^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {2 a b \cos ^{5}{\left (c + d x \right )}}{5 d} + \frac {b^{2} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {3 b^{2} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {3 b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {b^{2} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {b^{2} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} + \frac {b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} - \frac {b^{2} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )}\right )^{2} \cos ^{4}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 4.98, size = 123, normalized size = 1.06 \begin {gather*} \frac {1}{16} \, {\left (6 \, a^{2} + b^{2}\right )} x - \frac {a b \cos \left (5 \, d x + 5 \, c\right )}{40 \, d} - \frac {a b \cos \left (3 \, d x + 3 \, c\right )}{8 \, d} - \frac {a b \cos \left (d x + c\right )}{4 \, d} - \frac {b^{2} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} + \frac {{\left (2 \, a^{2} - b^{2}\right )} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} + \frac {{\left (16 \, a^{2} + b^{2}\right )} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.31, size = 134, normalized size = 1.16 \begin {gather*} \frac {3\,a^2\,x}{8}+\frac {b^2\,x}{16}+\frac {a^2\,{\cos \left (c+d\,x\right )}^3\,\sin \left (c+d\,x\right )}{4\,d}+\frac {b^2\,{\cos \left (c+d\,x\right )}^3\,\sin \left (c+d\,x\right )}{24\,d}-\frac {b^2\,{\cos \left (c+d\,x\right )}^5\,\sin \left (c+d\,x\right )}{6\,d}-\frac {2\,a\,b\,{\cos \left (c+d\,x\right )}^5}{5\,d}+\frac {3\,a^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{8\,d}+\frac {b^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{16\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________